{include file="public/header"/}



<div id="container" style="overflow-y: auto;">
   <div class="row" style="margin:0px;">
      <div class="col-lg-12">
         <h3 class="page-header" style="font-size: 20px;"><i class="am-icon-cubes"></i>  所有网站数据总览</h3>
       </div>   
   </div> 


   <div class="row" style="margin: 0px;">

        <form method="post" action="/manager/index/index" class="layui-form-item" style="width: 30%;position: relative;margin-left: 5%;">
            <input type="text" name="key"  class="layui-input">
            <input class="layui-btn" type='submit' style="position:absolute;right: 0px;top:0px;" value="搜索">
        </form>
       
   </div>
  
 
   <div  style="margin-top: 5px;">

    <div class="selist" style="width: 90%;margin:5px auto">
        <table class="table">
            <thead>
            <tr>
                <th>web</th>
                <th>正在谈话人数</th>
                <th>在线客服人数</th>
                <th>正在排队人数</th>
                <th>接入会话总人数</th>
                <th>今日会话量</th>
                <th>会话总量</th>
                <th>今日留言量</th>
                <th>留言总量</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="datasheet">

              {if $data}

                {volist name='data' id='v'}
                   <tr>
                       <td>{$v.web}</td>
                       <td>{$v.talk}</td>
                       <td>{$v.service}</td>
                       <td>{$v.wait}</td>
                       <td>{$v.visited}</td>
                       <td>{$v.nowchat}</td>
                       <td>{$v.totalchat}</td>
                       <td>{$v.nowmsg}</td>
                       <td>{$v.totalmsg}</td>
                       {if $v.state == 'open'}
                         <td><button class="btn btn-danger" onclick="manager('{$v.web}','{$v.state}')">禁用</button></td>
                         
                       {else}
                          <td><button class="btn btn-success" onclick="manager('{$v.web}','{$v.state}')">解禁</button></td>
                       {/if}
                     
                   </tr>     
                  
                {/volist}

              {else}
              
                 <tr>
                    <td colspan='10'><center>没有相关数据</center></td>
                 </tr>
              
              {/if}  
        
            </tbody>
            {$page}

        </table>

      
        
    </div>

 
       
   </div>
   
   
</div>
<script>
  
  var manager =function(str,type){

    $.ajax({
      url:"{:url('manager/set/change')}",
      type:'post',
      data:{business_id:str,type:type},
      success:function(res){

         if(res){
           
           layer.msg('更改成功！',{icon:1,end:function(){
               location.reload();
           }});

         }else{

           layer.msg('更改失败！',{icon:2});

         }

      }
    })
  }
</script>



{include file="public/footer"/}


